<?php defined('_JEXEC') or die('Restricted access'); 
$TableName = JRequest::getCmd('table');
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
JHTML::_('behavior.tooltip');
jimport('joomla.html.pane');
JHTML::_('behavior.formvalidation');
if(!JRequest::getVar('Itemid')){$Itemid = 0;}
else{$Itemid = JRequest::getVar('Itemid');}

$pane =& JPane::getInstance('tabs', array('startOffset'=>0)); 
//print_r($this->user);
$lang =& JFactory::getLanguage();
	
 ?>
<script type="text/javascript">
function ChangeState(a){
var progressSt = $('progressSt');
new Ajax("<?php echo JURI::base();?>index.php?option=com_properties&controller=ajax&format=raw&task=ChangeState",
{method: 'get',
onRequest: function(){progressSt.setStyle('visibility', 'visible');},
onComplete: function(){progressSt.setStyle('visibility', 'hidden');},
update: $('AjaxState'), 
data: 'Country_id='+a}).request();
			}	
			
function ChangeLocality(a){
var progressL = $('progressL');
new Ajax("<?php echo JURI::base();?>index.php?option=com_properties&controller=ajax&format=raw&task=ChangeLocality",
{method: 'get',
onRequest: function(){progressL.setStyle('visibility', 'visible');},
onComplete: function(){progressL.setStyle('visibility', 'hidden');},
update: $('AjaxLocality'), 
data: 'State_id='+a}).request();
			}	
			
function irUrlPanel(){
alert('here');
document.getElementById('task').value = '';
window.location.href='<?php echo JRoute::_( 'index.php?option=com_properties&view=panel' );?>';
}		
</script>
<!-- thuan add js script for player -->
<script type='text/javascript' src='components/com_properties/includes/player/swfobject.js'></script>
<script type='text/javascript'>
function playFlv(file)
{
  var so = new SWFObject('components/com_properties/includes/player/player.swf','mpl','400','300','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file',"../../../../images/properties/"+file);
  so.write('mediaspace');
}
function playWmv(file)
{
	alert(file);
	var mediaspace = document.getElementById("mediaspace");
	mediaspace.innerHTML = "<embed autostart=\"1\" type=\"application/x-mplayer2\""+ 
	"src=\"images/properties/"+file+"\""+ 
		"name=\"MediaPlayer\" width=400 height=300></embed>";
}
</script>
<!-- end: thuan add js script for player -->
<form action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="adminForm2" id="adminForm2" class="form-validate" enctype="multipart/form-data" >

<!-- Thuan hide 2 top button 04-09-09  -->
<!--<div class="botones">

<div class="boton">
<button class="button_cancel" onclick="irUrlPanel();"><span class="txt"><?php echo JText::_('Cancel'); ?></span></button>
</div>
<div class="boton">
<button class="mbutton_apply" type="submit"><span class="txt"><?php echo JText::_('Apply'); ?></span></button>
</div>

<div class="clr"></div>
</div>	
-->
<!-- end Thuan hide 2 button --> 
<br><br>

<?php //echo date('d-m-Y', strtotime($listdate)); ?>
<div class="col width-100">
<?php

//print_r( $this->ProductAgent);

echo $pane->startPane( 'pane' );
echo $pane->startPanel( JText::_( 'Details'), 'panel1' );
?>
	<fieldset class="adminform">    
	<legend><?php echo JText::_( 'Details' ); ?></legend>
				<table class="admintable">
				<tr>
					<td class="key"><label for="name"><?php echo JText::_( 'Reference' ); ?>:</label></td>
					<td>
						<input class="inputbox" type="text" name="ref" id="ref" size="10" maxlength="255" value="<?php echo $this->datos->ref; ?>" />
                       
					</td>
				</tr>
                <tr>
					<td class="key"><label for="name"><?php echo JText::_( 'Title' ); ?>:</label></td>
					<td>
<input class="inputbox required" type="text" name="name" id="name" size="30" maxlength="255" value="<?php echo htmlspecialchars($this->datos->name); ?>" />
					</td>
				</tr>
				<tr>
					<td class="key"><label for="type"><?php echo JText::_( 'Type' ); ?>:</label></td>
					<td >
                     <?php echo SelectHelper::SelectType( $this->datos,'type',$this->datos->type); ?>
						</td>
				</tr>
				
                
                <tr>        
<td width="100" class="key">
		<label for="category"><?php echo JText::_( 'Category' ); ?>:</label>
			</td>
<td>
<?php echo CatTreeHelper::Parent( $this->datos,'category' ); ?>

</td>
		</tr> 
   			<tr>        
<td width="100" class="key">
		<label for="varies categories"><?php echo JText::_( 'Varies Categories' ); ?>:</label>
			</td>
<td>

<?php echo CatTreeHelper::MultiParent( $this->datos,'category' ); ?>

</td>
		</tr>       
        
<tr>
					<td class="key"><label for="country"><?php echo JText::_( 'Country' ); ?>:</label></td>
					<td>
                    <?php echo SelectHelper::SelectAjaxPaises( $this->datos,'country',$this->datos->cyid); ?>
                </td>   
				<tr>                
                <td class="key"><label for="state"><?php echo JText::_( 'State' ); ?>:</label></td>
					<td>
                    <div id="AjaxState" style="float:left">
<input type="hidden" name="sid" id="sid" value="<?php echo $this->datos->sid; ?>" />
						<?php echo $this->datos->name_state;?>
</div>        <div id="progressSt"></div>          
                    </td>
                    <td>
					<?php echo JHTML::_('tooltip', JText::_( 'Change Country, State and after, Locality.' )); ?>
					
					</td>
				</tr>
				<tr><td class="key"><?php echo JText::_( 'Locality' ); ?>:</td>
					<td>
	        <div id="AjaxLocality" style="float:left">     
            <input type="hidden" name="lid" id="lid" value="<?php echo $this->datos->lid; ?>" />      
   <?php                      
 echo $this->datos->name_locality;
?>                       
  </div>     <div id="progressL"></div>                
                        
                                               
					</td>
				</tr>
                <tr><td class="key"><?php echo JText::_( 'Address' ); ?>:</td>
					<td>
						<input class="text_area" type="text" name="adress" id="adress" size="30" maxlength="255" value="<?php echo $this->datos->adress; ?>" />                        
					</td>
				</tr>
                <tr>
					<td class="key"><label for="zip code"><?php echo JText::_( 'Zip Code' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="postcode" id="postcode" size="10" maxlength="255" value="<?php echo $this->datos->postcode; ?>" />						
					</td>
				</tr>
  
                <tr>
					<td class="key"><label for="featured"><?php echo JText::_( 'Featured' ); ?>:</label></td>
					<td >
<?php $chequeado0 = $this->datos->featured ? JText::_( '' ) : JText::_( 'checked="checked"' );?>
<?php $chequeado1 = $this->datos->featured ? JText::_( 'checked="checked"' ) : JText::_( '' );?>
                    <input name="featured" id="featured0" value="0" <?php echo $chequeado0;?> type="radio">
	<label for="featured0"><?php echo JText::_( 'No' ); ?></label>
	<input name="featured" id="featured1" value="1" <?php echo $chequeado1;?> type="radio">
	<label for="featured1"><?php echo JText::_( 'Yes' ); ?></label>  
					</td>
				</tr>
                <tr>
					<td class="key"><label for="published"><?php echo JText::_( 'Published' ); ?>:</label></td>
					<td >
<?php $chequeado0 = $this->datos->published ? JText::_( '' ) : JText::_( 'checked="checked"' );?>
<?php $chequeado1 = $this->datos->published ? JText::_( 'checked="checked"' ) : JText::_( '' );?>
                    <input name="published" id="published0" value="0" <?php echo $chequeado0;?> type="radio">
	<label for="published0"><?php echo JText::_( 'No' ); ?></label>
	<input name="published" id="published1" value="1" <?php echo $chequeado1;?> type="radio">
	<label for="published1"><?php echo JText::_( 'Yes' ); ?></label>  
					</td>
				</tr>
                <tr>
					<td class="key"><label for="details market"><?php echo JText::_( 'Details Market' ); ?>:</label></td>
					<td >
                                       
<?php 
if($this->datos->available == 0){$select0 = JText::_( 'selected="selected"' );}
if($this->datos->available == 1){$select1 = JText::_( 'selected="selected"' );}
if($this->datos->available == 2){$select2 = JText::_( 'selected="selected"' );}
if($this->datos->available == 3){$select3 = JText::_( 'selected="selected"' );}
if($this->datos->available == 4){$select4 = JText::_( 'selected="selected"' );}
if($this->datos->available == 5){$select5 = JText::_( 'selected="selected"' );}
if($this->datos->available == 6){$select6 = JText::_( 'selected="selected"' );}
?>
                   
         <select name="available" style="width:150px;"> 
			<option <?php echo $select0;?> value="0"><?php echo JText::_( 'DETAILS_MARKET0' ); ?></option>
            <option <?php echo $select1;?> value="1"><?php echo JText::_( 'DETAILS_MARKET1' ); ?></option>
            <option <?php echo $select2;?> value="2"><?php echo JText::_( 'DETAILS_MARKET2' ); ?></option>
            <option <?php echo $select3;?> value="3"><?php echo JText::_( 'DETAILS_MARKET3' ); ?></option>
            <option <?php echo $select4;?> value="4"><?php echo JText::_( 'DETAILS_MARKET4' ); ?></option>
            <option <?php echo $select5;?> value="5"><?php echo JText::_( 'DETAILS_MARKET5' ); ?></option>
            <option <?php echo $select6;?> value="6"><?php echo JText::_( 'DETAILS_MARKET6' ); ?></option>
         </select>
              
                    
                    
                    
					</td>
				</tr>
                 <tr>
                    <td class="key"><label>
								<?php echo JText::_( 'Upload Panoramic' ); ?>:
							</label></td>
                    <td>
                    <input class="input_box" id="panoramic" name="panoramic" size="30" type="file" />
                    </td>
                    <td><?php echo JHTML::_('tooltip', JText::_( 'TOOLTIP_CHANGE_PANORAMIC')); ?></td>
                    </tr>
				<tr>
					<td class="key"><label for="image"><?php echo JText::_( 'Image' ); ?>:</label></td>
					<td >
                   <?php 
				$img_path = JURI::root().'images/properties/'.$this->datos->image1;
			
			
			
			?>
<span class="editlinktip hasTip" title="<?php echo $this->datos->image1;?>::
<img border=&quot;1&quot; src=&quot;<?php echo $img_path; ?>&quot; name=&quot;imagelib&quot; alt=&quot;<?php echo JText::_( 'No preview available'.$img_path ); ?>&quot; width=&quot;206&quot; height=&quot;145&quot; />">
<a class="modal" rel="{handler: 'iframe', size: {x: 640, y: 480}}" href="<?php echo $img_path; ?>"><?php echo $this->datos->image1; ?></a></span>						
					</td>
				</tr>	
                	
                    <tr>
					<td class="key"><label for="image"><?php echo JText::_( 'Panoramic' ); ?>:</label></td>
					<td >
                   <?php 
				 
			$img_path = JURI::root().'images/properties/panoramics/'.$this->datos->panoramic;?>
<span class="editlinktip hasTip" title="<?php echo $this->datos->image1;?>::
<img border=&quot;1&quot; src=&quot;<?php echo $img_path; ?>&quot; name=&quot;imagelib&quot; alt=&quot;<?php echo JText::_( 'No preview available'.$img_path ); ?>&quot; width=&quot;206&quot; height=&quot;100&quot; />">
<a class="modal" rel="{handler: 'iframe', size: {x: 640, y: 480}}" href="<?php echo $img_path; ?>"><?php echo $this->datos->panoramic; ?></a></span>						
					</td>
				</tr>	
                		
				<?php
				if ($this->datos->id) {
					?>
					<tr>
						<td class="key">
							<label>
								<?php echo JText::_( 'ID' ); ?>:
							</label>
						</td>
						<td>
							<strong><?php echo $this->datos->id;?></strong>
						</td>
					</tr> 
					<?php
				}
				?>
                <tr>
 <tr>
					<td class="key">
						<label for="clave">
							<?php echo JText::_( 'Clave' ); ?>:
						</label>
					</td>
					<td >
						<input class="text_area" type="text" name="clave" id="clave" size="20" maxlength="255" value="<?php echo $this->datos->clave; ?>" />
					</td>
				</tr>     
                
                <tr>
					<td class="key">
						<label for="agent">
							<?php echo JText::_( 'Agent' ); ?>:
						</label>
					</td>
					<td >
                   
                <?php echo $this->datos->agent; ?>
                    </td>
				</tr>  
				</table>
			</fieldset>  
<?php 
echo $pane->endPanel();
echo $pane->startPanel( JText::_( 'Featured'), 'panel2' );
?>
	<fieldset class="adminform">    
	<legend><?php echo JText::_( 'Caractristics' ); ?></legend>
				<table class="admintable">
              <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'DESCRIPTION' ); ?>:</label></td>
					<td >
                    <textarea class="text_area" name="description" cols="25" rows="10"><?php echo $this->datos->description; ?></textarea>
                    						
					</td>
                    <td><?php echo JHTML::_('tooltip', JText::_( 'Breve descripción del producto, para agragar mas detalles seleccione la solapa superior Descripción.')); ?></td>
				</tr>
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Price' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="price" id="price" size="10" maxlength="255" value="<?php echo $this->datos->price; ?>" />						
					</td>
				</tr>                
                                
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Years' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="years" id="years" size="3" maxlength="255" value="<?php echo $this->datos->years; ?>" />						
					</td>
				</tr>
                 <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Bedrooms' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="bedrooms" id="bedrooms" size="3" maxlength="255" value="<?php echo $this->datos->bedrooms; ?>" />						
					</td>
				</tr>
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Bathrooms' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="bathrooms" id="bathrooms" size="3" maxlength="255" value="<?php echo $this->datos->bathrooms; ?>" />						
					</td>
				</tr>
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Garage' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="garage" id="garage" size="3" maxlength="255" value="<?php echo $this->datos->garage; ?>" />						
					</td>
                    <td>
					<?php echo JHTML::_('tooltip', JText::_( 'Cantidad de autos que entran en el garage.' )); ?>
					
					</td>
				</tr>     
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Total Area' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="area" id="area" size="3" maxlength="255" value="<?php echo $this->datos->area; ?>" />						
					</td>
				</tr>
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Covered Area' ); ?>:</label></td>
					<td>
                    <input class="text_area" type="text" name="covered_area" id="covered_area" size="3" maxlength="255" value="<?php echo $this->datos->covered_area; ?>" />						
					</td>
				</tr>                
<?php
$extra[1]=$this->datos->extra1;
$extra[2]=$this->datos->extra2;
$extra[3]=$this->datos->extra3;
$extra[4]=$this->datos->extra4;
$extra[5]=$this->datos->extra5;
$extra[6]=$this->datos->extra6;
$extra[7]=$this->datos->extra7;
$extra[8]=$this->datos->extra8;
$extra[9]=$this->datos->extra9;
$extra[10]=$this->datos->extra10;
$extra[11]=$this->datos->extra11;
$extra[12]=$this->datos->extra12;
$extra[13]=$this->datos->extra13;
$extra[14]=$this->datos->extra14;
$extra[15]=$this->datos->extra15;
$extra[16]=$this->datos->extra16;
$extra[17]=$this->datos->extra17;
$extra[18]=$this->datos->extra18;
$extra[19]=$this->datos->extra19;
$extra[20]=$this->datos->extra20;

for ($x=1;$x<11;$x++){
echo '<tr>
	<td class="key"><label for="extra">'. JText::_( 'extra'.$x ).'</label></td>
<td>
';
$chequeado0 = $extra[$x] ? JText::_( '' ) : JText::_( 'checked="checked"' );
$chequeado1 = $extra[$x] ? JText::_( 'checked="checked"' ) : JText::_( '' );
echo'
<input name="extra'.$x.'0" id="extra'.$x.'0" value="0" '.$chequeado0.' type="radio">
	<label for="featured0">'.JText::_( 'No' ).'</label>
	<input name="extra'.$x.'" id="extra'.$x.'1" value="1" '.$chequeado1.' type="radio">
	<label for="featured1">'.JText::_( 'Yes' ).'</label> 

</td></tr>
';
}
for ($x=11;$x<21;$x++){
echo '<tr>
	<td class="key"><label for="extra">'. JText::_( 'extra'.$x ).'</label></td>
<td><input class="text_area" type="text" name="extra'.$x.'" id="extra'.$x.'" size="20" maxlength="255" value="'.$extra[$x].'" />
</td></tr>
';
}
?>                 
				</table>
			</fieldset> 
<?php
echo $pane->endPanel();
echo $pane->startPanel( JText::_( 'Images'), 'panel2' );

$img_path = JURI::root().'images/properties/';
$peque_path = JURI::root().'images/properties/peques/';
?>
<input type="hidden" name="borrar" id="borrar" value="" />     

<legend><?php echo JText::_( Images ); ?></legend>
<table class="admintable">
<tr>
	<td >    
		
<?php 
$img_dato[1]=$this->datos->image1;
$img_dato[2]=$this->datos->image2;
$img_dato[3]=$this->datos->image3;
$img_dato[4]=$this->datos->image4;
$img_dato[5]=$this->datos->image5;
$img_dato[6]=$this->datos->image6;
$img_dato[7]=$this->datos->image7;
$img_dato[8]=$this->datos->image8;
$img_dato[9]=$this->datos->image9;
$img_dato[10]=$this->datos->image10;
$img_dato[11]=$this->datos->image11;
$img_dato[12]=$this->datos->image12;
$img_dato[13]=$this->datos->image13;
$img_dato[14]=$this->datos->image14;
$img_dato[15]=$this->datos->image15;
$img_dato[16]=$this->datos->image16;
$img_dato[17]=$this->datos->image17;
$img_dato[18]=$this->datos->image18;
$img_dato[19]=$this->datos->image19;
$img_dato[20]=$this->datos->image20;
$img_dato[21]=$this->datos->image21;
$img_dato[22]=$this->datos->image22;
$img_dato[23]=$this->datos->image23;
$img_dato[24]=$this->datos->image24;

$img_des[1]=$this->datos->image1desc;
$img_des[2]=$this->datos->image2desc;
$img_des[3]=$this->datos->image3desc;
$img_des[4]=$this->datos->image4desc;
$img_des[5]=$this->datos->image5desc;
$img_des[6]=$this->datos->image6desc;
$img_des[7]=$this->datos->image7desc;
$img_des[8]=$this->datos->image8desc;
$img_des[9]=$this->datos->image9desc;
$img_des[10]=$this->datos->image10desc;
$img_des[11]=$this->datos->image11desc;
$img_des[12]=$this->datos->image12desc;
$img_des[13]=$this->datos->image13desc;
$img_des[14]=$this->datos->image14desc;
$img_des[15]=$this->datos->image15desc;
$img_des[16]=$this->datos->image16desc;
$img_des[17]=$this->datos->image17desc;
$img_des[18]=$this->datos->image18desc;
$img_des[19]=$this->datos->image19desc;
$img_des[20]=$this->datos->image20desc;
$img_des[21]=$this->datos->image21desc;
$img_des[22]=$this->datos->image22desc;
$img_des[23]=$this->datos->image23desc;
$img_des[24]=$this->datos->image24desc;

for($z=1;$z<25;$z++){

$img_peque[$z]=$peque_path.'peque_'.$img_dato[$z];
$img=$img_path.$img_dato[$z];

?>

<div style="float:left; width:140px; height:200px; border: 1px solid #CCCCCC; margin: 5px; padding: 0px; text-align:center;">
<?php

echo '<div>'.JText::_( 'Image '.$z );
if($img_dato[$z]!=''){
	
echo ' ('.$img_dato[$z]. ') </div>'; 
$rel=' rel="{handler: \'iframe\', size: {x: 640, y: 480}}"';
$style = ' style="padding: 2px;border: 1px solid grey"';		
	
echo '<a class="modal" href="'.$img.'" title="'. $row->titulo.'"  >';
echo '<img width="100" height="75" src="'. $img_peque[$z] .'" alt="'. $row->titulo.'" '.$rel.$style.' />';
echo '</a>';
?>
<br />




<a href="<?php echo JRoute::_( 'index.php?option=com_properties&view=panel&task=removeImgProperty&id='.$this->datos->id.'&img='.$z);?>" title="<?php echo JText::_( 'Delete Image' ); ?>">
<?php echo JText::_( 'Delete' ); ?>
<img src="images/properties/tools/publish_x.png" alt="<?php echo JText::_( 'Delete Image' ); ?>" border="0"></a>
<?php echo '<br/><br/>'.JText::_( 'Image Description' ); ?>
<input style="width:120px;" class="textarea" type="text" name="<?php echo 'image'.$z.'desc'; ?>" id="<?php echo 'image'.$z.'desc'; ?>" size="10" maxlength="255" value="<?php echo $img_des[$z]; ?>" />	
 <?php       
 }else{
?>
</div>
<br />
<img src=<?php echo $peque_path.'peque_noimage.jpg' .$style;?> />
<?php echo '<br>'.JText::_( 'Image Description' ); ?>
<input style="width:120px;" class="text_area" type="text" name="<?php echo 'image'.$z.'desc'; ?>" id="<?php echo 'image'.$z.'desc'; ?>" size="20" maxlength="255" value="" />	
 <br/><br/><input type="file" size="5" name="files[<?php echo $z; ?>]" value=""/>
 <?php  } ?>
       
		</div>
                    
   <?php  } ?>                  
    </td>
</tr> 
</table>          


<?php 
echo $pane->endPanel();

echo $pane->startPanel( JText::_( 'Map'), 'panel4' );
?>
<fieldset class="adminform">
				<legend><?php echo JText::_( 'Coordinates' ); ?></legend>
                   
	<!-- Thien: add GMap here -->
	<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" 
            type="text/javascript"></script>
	
<table class="admintable"><tr><td>                
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Latitude' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="lat" id="lat" size="20" maxlength="255" value="<?php echo $this->datos->lat; ?>" />
						
					</td>
                    <td rowspan="2"><?php echo JHTML::_('tooltip', JText::_( 'Latitude y longitude to center a property in map.')); ?></td>
				</tr>
                
                <tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Longitude' ); ?>:</label></td>
					<td >
                    <input class="text_area" type="text" name="lng" id="lng" size="20" maxlength="255" value="<?php echo $this->datos->lng; ?>" />
						
					</td>
                    
				</tr>

                
                <!--
				<tr>
					<td class="key"><label for="user_id"><?php echo JText::_( 'Get' ).' '.JText::_( 'Coord' ); ?>:</label></td>
					<td >
                   <strong><a href="http://maps.google.com/maps?ll=40.418103,-3.713722&spn=0.015683,0.027466&z=15&key=ABQIAAAAFHktBEXrHnX108wOdzd3aBRcHlBTpYb_p9Hgr3VvSklsWletSxRtPnaBg-v2NXy9jFYSYS_aNOHN1Q&oi=map_misc&ct=api_logo" target="_blank" title="mapa" >  <?php echo JText::_( 'Get' ).' '.JText::_( 'Coord' ); ?></a></strong>
						
					</td>
                    <td><?php echo JHTML::_('tooltip', JText::_( 'Coord googlemap for show location your property')); ?></td>
				</tr>  -->
              
				<tr>
					<td class="key" colspan="3" ><label for="user_id"><?php echo JText::_( 'Map' ); ?>:</label></td>
				</tr>
				<tr>
					<td colspan="3"><div id="map_canvas" style="width: 470px; height: 400px"></div></td>
				</tr>
				
</table>
	<script type="text/javascript">

    var map;
    var geocoder;
    var address;

    //function initialize() {
      map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(10.773417,106.648915), 15);
      map.setUIToDefault();
      GEvent.addListener(map, "click", getAddress);
      geocoder = new GClientGeocoder();
    //}
    
    function getAddress(overlay, latlng) {
      if (latlng != null) {
        address = latlng;
        geocoder.getLocations(latlng, showAddress);
      }
    }

    function showAddress(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Status Code:" + response.Status.code);
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(
        //'<b>orig latlng:</b>' + response.name + '<br/>' + 
        //'<b>latlng:</b>' + place.Point.coordinates[1] + "," + place.Point.coordinates[0] + '<br>' +
        //'<b>Status Code:</b>' + response.Status.code + '<br>' +
        //'<b>Status Request:</b>' + response.Status.request + '<br>' +
        '<b>Address:</b>' + place.address + '<br>' +
        //'<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>' +
        '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
		document.getElementById("lat").value=place.Point.coordinates[1];
		document.getElementById("lng").value=place.Point.coordinates[0];
      }	  
    }


    </script>
	<!-- Thien: end edit -->
</fieldset>


<?php				            	

echo $pane->endPanel();
//Thuan add video tab 27-08-09
echo $pane->startPanel( JText::_( 'Video'), 'panel5' );
?>

<fieldset class="adminform">
<legend><?php echo JText::_( 'Upload video' ); ?></legend>
                
<table class="admintable">
<tr><td colspan="3">
<?php
	if(!empty($this->datos->video))
	{ 
		$ext = end(explode(".",$this->datos->video));
		echo "<div id=\"mediaspace\"style=\"text-align:center;\"></div>";
		if($ext == "flv")
		{
			echo "<script>playFlv('".$this->datos->video."')</script>";
		}
		if($ext == "wmv")
		{
			echo "<script>playWmv('".$this->datos->video."')</script>";
		}
	}
?>
<input type="hidden" name="video_edit" value="<?php echo $this->datos->video;?>">
</td></tr>
<tr>
	<td class="key"><label for="video"><?php echo JText::_( 'Video' ); ?>:</label></td>
	<td><input id="video" name="video" type="file" /></td>
<td><?php echo JHTML::_('tooltip', JText::_( 'Upload your video here.')); ?></td>
</tr>              
</table>
</fieldset>

<?php

echo $pane->endPanel();
//Thuan end

echo $pane->endPane();

?>
<!-- Thuan edit button style 04-09-09  -->
<div class="botones">

<div class="boton">
<button class="button_cancel" onclick="irUrlPanel();"><span class="mtxt"><?php echo JText::_('Cancel'); ?></span></button>
</div>
<div class="boton">
<button class="mbutton_apply" type="submit"><span class="mtxt"><?php echo JText::_('Apply'); ?></span></button>

</div>
<div class="clr"></div>
</div>
<!-- Thuan end-->

<div class="clr"></div>
<input type="hidden" name="option" value="com_properties" />
<input type="hidden" name="view" value="panel" />
<input type="hidden" name="id" value="<?php echo $this->datos->id; ?>" />
<input type="hidden" name="table" value="products" />
<input type="hidden" name="task" id="task" value="apply" />
<input type="hidden" name="lang" value="<?php echo substr($lang->getTag(),0,2); ?>" />
<input type="hidden" name="controller" value="property" />

<input type="hidden" id="agent_id" name="agent_id" value="<?php echo $user->id; ?>" />
<input type="hidden" id="agent" name="agent" value="<?php echo $user->username; ?>" />
<?php $listdate = $this->datos->listdate ? date("Y-m-d") : $this->datos->listdate;?>
<input type="hidden" id="listdate" name="listdate" value="<?php echo $listdate; ?>" />

	<?php echo JHTML::_( 'form.token' ); ?>
	</form>
    </div>
	<br />